package com.leetcode.demo3Solution.java;

import javafx.scene.control.IndexRange;
//1308.猜数字
import java.util.Arrays;

public class caiNumber {
    public static void main(String[] args) {
        int [] a={1,2,4};
        int [] b={1,2,3};
        System.err.println(game(a,b));
    }
    public static int game(int[] guess, int[] answer) {
        int res=0;
        if(Arrays.equals(answer, guess)) {
            return 3;
        }
        for(int i=0;i<3;i++) {
            if(guess[i]==answer[i]) {
                res++;
            }
        }

        return res;

    }
}
